package com.seagull.sb.bo.impl;

import java.util.Collections;
import java.util.List;

import com.seagull.sb.bo.OrganizationBO;
import com.seagull.sb.dao.OrganizationDAO;
import com.seagull.sb.domain.Division;
import com.seagull.sb.domain.Organization;
import com.seagull.sb.domain.Subject;
import com.seagull.sb.domain.Teacher;
import com.seagull.sb.util.SBRequestContext;

public class OrganizationBOImpl extends BaseBOImpl implements OrganizationBO{
	private OrganizationDAO organizationDAO;

	@Override
	public List<Teacher> getTeachers(SBRequestContext rc) throws Exception {
		try{
			 return organizationDAO.getTeachers(rc);
		}catch(Exception e){
			e.printStackTrace();
		}
		return Collections.EMPTY_LIST;
	}

	@Override
	public List<Division> getDivisions(SBRequestContext rc) throws Exception {
		try{
			 return organizationDAO.getDivisions(rc);
		}catch(Exception e){
			e.printStackTrace();
		}
		return Collections.EMPTY_LIST;
	}

	@Override
	public Organization getOrganization(SBRequestContext rc) throws Exception {
		try{
			 return organizationDAO.getOrganization(rc);
		}catch(Exception e){
			e.printStackTrace();
		}
		return new Organization();
	}

	public OrganizationDAO getOrganizationDAO() {
		return organizationDAO;
	}

	public void setOrganizationDAO(OrganizationDAO organizationDAO) {
		this.organizationDAO = organizationDAO;
	}

	@Override
	public List<Subject> getSubjects(SBRequestContext rc) throws Exception {
		try{
			 return organizationDAO.getSubjects(rc);
		}catch(Exception e){
			e.printStackTrace();
		}
		return Collections.EMPTY_LIST;
	}

}
